package com.example.s3demo.service

import com.example.s3demo.model.*
import java.io.InputStream


interface S3Service {
    fun createBucket(bucketName: String): Bucket

    fun deleteBucket(bucketName: String)

    fun listBuckets(): List<Bucket>

    fun headBucket(bucketName: String): Boolean

    fun listObjects(bucketName: String, prefix: String): List<S3Object>

    fun headObject(bucketName: String, objectKey: String): HashMap<String, String>

    fun getObject(bucketName: String, objectKey: String): S3ObjectInputStream?

    fun deleteObject(bucketName: String, objectKey: String)

    fun putObject(bucketName: String, objectKey: String, inputStream: InputStream)

    fun copyObject(
        sourceBucketName: String,
        sourceObjectKey: String,
        targetBuckName: String,
        targetObjectKey: String
    )

    fun initiateMultipartUpload(bucketName: String, objectKey: String): InitiateMultipartUploadResult

    fun uploadPart(
        bucketName: String,
        objectKey: String,
        partNumber: Int,
        uploadId: String,
        inputStream: InputStream
    ): PartETag

    fun completeMultipartUpload(
        bucketName: String,
        objectKey: String,
        uploadId: String,
        compMPU: CompleteMultipartUpload
    ): CompleteMultipartUploadResult
}
